#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>
//int my_strcmp(const char* arr,const char* arr2) {
//	while (*arr == *arr2)
//	{
//		if (*arr == '\0')
//			return 0;
//		arr++;
//		arr2++;
//	}
//	return *arr - *arr2;
//}
//int main()
//{
//	char arr[] = "abcdef";
//	char arr2[] = "abcdef";
//	printf("%d\n", strcmp(arr, arr2));
//	printf("%d", my_strcmp(arr, arr2));
//}




//char* my_strcat(char* arr,const char* arr2) {
//	char* ret = arr;
//	while (*arr)
//	{
//		arr++;
//	}
//	while (*arr = *arr2)
//	{
//		arr++;
//		arr2++;
//	}
//	return ret;
//}
//int main()
//{
//	char arr[60] = "abcdefg";
//	char arr2[60] = "abcdefg";
//	char arr3[] = "hijklmn";
//	printf("%s\n", strcat(arr, arr3));
//	printf("%s", my_strcat(arr2, arr3));
//}




const char* my_strstr(const char* arr,const char* arr2) {
	const char* ret = arr;
	while (*ret)
	{
		const char* ret1 = ret;
		const char* ret2 = arr2;
		while (*ret1 && *ret2 && *ret1 == *ret2)
		{
			ret1++;
			ret2++;
		}
		if (*ret2 == '\0')
			return ret;
		ret++;
	}
	return NULL;
}
int main()
{
	char arr[] = "abcdef";
	char arr2[] = "bc";
	printf("%s\n", strstr(arr, arr2));
	printf("%s", my_strstr(arr, arr2));
}